path_max
authorDebian X Strike Force <debian-x@lists.debian.org>
Wed, 7 Jan 2026 12:26:39 +0000 (14:26 +0200)
committerTimo Aaltonen <tjaalton@debian.org>
Wed, 7 Jan 2026 12:26:39 +0000 (14:26 +0200)
Gbp-Pq: Name path_max.diff

src/util/tests/cache_test.cpp
src/util/tests/process_test.c

index d1772f3240f4ac9d8e8ff79451dd13dbcb000bea..99ab9def0313849f3db4ea1de19fb065622c41d3 100644 (file)
@@ -88,8 +88,8 @@ check_directories_created(void *mem_ctx, const char *cache_dir)
 {
    bool sub_dirs_created = false;
 
-   char buf[PATH_MAX];
-   if (getcwd(buf, PATH_MAX)) {
+   char *buf = getcwd(NULL, 0);
+   if (buf) {
       char *full_path = ralloc_asprintf(mem_ctx, "%s%s", buf, ++cache_dir);
       struct stat sb;
       if (stat(full_path, &sb) != -1 && S_ISDIR(sb.st_mode))
index dd4e7bf8c7acf1dd7c689fb32875d31f35d02d64..0e937e2c134fa46f69e00a43b633f78fabc94638 100644 (file)
 #define PATH_MAX MAX_PATH
 #endif
 
+#if !defined(PATH_MAX) && defined(__GNU__)
+#define PATH_MAX (4096)
+#endif
+
 static bool error = false;
 
 static void